<?php
/**
 * @fileoverview    注册完成后提示激活页面
 * @author          zhanglei11
 * @date            Thu Jan 12 11:31:49 CST 2012
 * @copyright       sina meila
 */
include('../../__global.php');
//  发送邮件后期要修改成工厂方法，不然容易修改

class active extends ml_controller
{   
    private $email;
    private $type;  //  区分注册完的提示 还是 找回密码后的提示页
    private $page;
    public function initParam()    {
        
        $refer = $_SERVER['HTTP_REFERER'];
        $pos = strpos($refer,'forget');
        
        if($pos > 0) { //  忘记密码过来的
            $this->email = $this->input('email');
            $this->type = 2;
            $this->page = 'user::active_forgetpwd';
            $this->set_scope_var('type','forgetpwd');
        }else{
            $this->email = $this->__visitor['email'];
            $this->type = 1;
            $this->page = 'user::active';
            $this->loginProxy(ml_logout);
            $this->set_scope_var('type','regist');
        }
        $this->set_access(self::ACCESS_SELF , self::NOACCESS_REDIRECT );
    }
    
    public function checkParam() {
        
    }
    
    public function main()
    {
        
        $data = array();        
        $arr = explode('@',$this->email);
        
        global $mailArr;
        $mail_url = $mailArr[$arr[1]];
        
        if( empty($mail_url)) {
            $domain = 'http://mail.'.$mail_url;
        }else {
            $domain = 'http://'.$mail_url;
        }
        /*        
        if($arr[1] == 'gmail.com') {
            $domain = $arr[1];
        }else {
            $domain = 'http://mail.'.$arr[1];
        }
        */
        
        $data = array('domain'=>$domain,'email'=>$this->email,'type'=>$this->type);        

        $this->page_output($this->page,$data);

        die('');

    }
}
new active();
?>
